<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="css/eui.css">
    <script src="js/vue.js"></script>
    <script src="js/eui.js"></script>
    <script src="js/axios.min.js"></script>
</head>
<body>
<div id="app">
    <el-upload
            action="/appFile"
            name="addf"
            list-type="picture-card"
            :on-preview="handlePictureCardPreview"
            :on-remove="handleRemove">
        <i class="el-icon-plus"></i>
    </el-upload>
    <el-dialog :visible.sync="dialogVisible">
        <img width="100%" :src="dialogImageUrl" alt="">
    </el-dialog>
</div>
<script>
    let v=new Vue({
        el:"#app",
        data:function (){
            return {
                dialogImageUrl: '',
                dialogVisible: false
            }
        },
        methods:{
            handleRemove(file, fileList) {
                axios.get("/delete?fileName="+file.response).then(function (response) {
                    alert("文件删除成功");
                })
            },
            handlePictureCardPreview(file) {
                alert(file.url);
                this.dialogImageUrl = file.url;
                this.dialogVisible = true;
            }
        }
    })
</script>
</body>
</html>